import request from '@/utils/request'

// 获取通知列表
export function getNoticeList(params) {
  return request({
    url: '/admin/notices',
    method: 'get',
    params
  })
}

// 获取通知详情
export function getNoticeDetail(noticeId) {
  return request({
    url: `/admin/notices/${noticeId}`,
    method: 'get'
  })
}

// 添加通知
export function addNotice(data) {
  return request({
    url: '/admin/notices',
    method: 'post',
    data
  })
}

// 更新通知
export function updateNotice(noticeId, data) {
  return request({
    url: `/admin/notices/${noticeId}`,
    method: 'put',
    data
  })
}

// 删除通知
export function deleteNotice(noticeId) {
  return request({
    url: `/admin/notices/${noticeId}`,
    method: 'delete'
  })
}

// 发布通知
export function publishNotice(noticeId) {
  return request({
    url: `/admin/notices/${noticeId}/publish`,
    method: 'put'
  })
}

// 撤回通知
export function withdrawNotice(noticeId) {
  return request({
    url: `/admin/notices/${noticeId}/withdraw`,
    method: 'put'
  })
} 